package cinema;

public class Movie {
    private String name;
    private String director;
    private String actors;
    private String synopsis;
    private int duration; // 分钟
    private double rating; // 0-10分
    private boolean showing; // 是否正在上映

    public Movie(String name, String director, String actors,
                 String synopsis, int duration, double rating) {
        this.name = name;
        this.director = director;
        this.actors = actors;
        this.synopsis = synopsis;
        this.duration = duration;
        this.rating = rating;
        this.showing = true; // 新添加的电影默认为正在上映
    }

    // 获取影片详细信息
    public String getMovieInfo() {
        return String.format("""
                片名：%s
                导演：%s
                主演：%s
                简介：%s
                时长：%d分钟
                评分：%.1f/10
                状态：%s""",
                name, director, actors, synopsis, duration, rating,
                showing ? "正在上映" : "已下架");
    }

    //============ Getter 和 Setter 方法 ============//
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getActors() {
        return actors;
    }

    public void setActors(String actors) {
        this.actors = actors;
    }

    public String getIntroduction() {
        return synopsis;
    }

    public void setIntroduction(String synopsis) {
        this.synopsis = synopsis;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public double getRating() {
        return rating;
    }

    public void setRating(double rating) {
        this.rating = rating;
    }

    public boolean isShowing() {
        return showing;
    }

    public void setShowing(boolean showing) {
        this.showing = showing;
    }
}